package com.rules.admin.expression;

public class NewExpression implements Expression {
   private String source;
   private String newClass;

   public NewExpression(String source, String newClass) {
      this.source = source;
      this.newClass = newClass;
   }

   public void accept(ExpressionVisitor visitor) {
      visitor.vistor((Expression)this);
   }

   public String getNewClass() {
      return this.newClass;
   }

   public void setNewClass(String newClass) {
      this.newClass = newClass;
   }

   public String toString() {
      if ("newList".equals(this.newClass)) {
         return " new ArrayList()";
      } else {
         return "newMap".equals(this.newClass) ? " new HashMap()" : null;
      }
   }
}
